<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pe="http://primefaces.org/ui/extensions">


    <ui:define name="content">
        <h:outputStylesheet library="css" name="printing.css"></h:outputStylesheet>

        <h:panelGroup rendered="true" >
            <h:form id="frm">


                <p:panel header="Investigation Counts">
                    <f:facet name="header" >
                        <p:outputLabel value="Investigation Counts" 
                                       styleClass="noPrintButton"/>
                    </f:facet> 


                    <h:panelGrid columns="2" styleClass="noPrintButton">                        
                        <p:commandButton ajax="false"  value="Process"  
                                         action="#{investigationMonthSummeryOwnControllerSession.createInvestigationExistTable}"
                                         styleClass="noPrintButton" style="float: right;" />

                        <p:commandButton value="Excel" ajax="false" styleClass="noPrintButton" style="float: right;" >
                            <pe:exporter type="xlsx" target="tbl" fileName="Investigation_exist"/>
                        </p:commandButton>

                        <p:commandButton ajax="false" value="Print" styleClass="noPrintButton" >
                            <p:printer target="panelPrint" />
                        </p:commandButton>

                    </h:panelGrid>


                    <p:panel id="panelPrint" styleClass="noBorder summeryBorder" >

                        <p:dataTable id="tbl"  value="#{investigationMonthSummeryOwnControllerSession.items}" var="c" 
                                     rowIndexVar="i">

                            <f:facet name="header" >
                                <h:outputLabel value="Investigation Exist Report"/>
                            </f:facet>



                            <p:column >
                                <h:outputLabel value="#{i+1}"  />

                            </p:column>

                            <p:column headerText="Test ID" 
                                      sortBy="#{c.investigation.id}" 
                                      filterBy="#{c.investigation.id}"
                                      filterMatchMode="contains">
                                <f:facet name="header">
                                    <h:outputLabel value="Test ID"/>
                                </f:facet>

                                <h:outputLabel value="#{c.investigation.id}"  />

                            </p:column>

                            <p:column headerText="Test Name" 
                                      sortBy="#{c.investigation.name}" 
                                      filterBy="#{c.investigation.name}"
                                      filterMatchMode="contains">
                                <f:facet name="header">
                                    <h:outputLabel value="Test Name"/>
                                </f:facet>

                                <h:outputLabel value="#{c.investigation.name}"  />

                            </p:column>
                             <p:column headerText="Dept" 
                                      sortBy="#{c.investigation.name}" 
                                      filterBy="#{c.investigation.name}"
                                      filterMatchMode="contains">
                                <f:facet name="header">
                                    <h:outputLabel value="Test Name"/>
                                </f:facet>

                                 <h:outputLabel value="#{c.investigation.department.name}"  />

                            </p:column>
                            <p:column headerText="Exist" 
                                      sortBy="#{c.b}" 
                                      filterBy="#{c.b}"
                                      filterMatchMode="contains" style="text-align: center;">
                                <h:outputLabel value="Available" rendered="#{c.b eq 'true'}" style="color: green;"/>
                                <h:outputLabel value="Not-Available" rendered="#{c.b eq 'false'}" style="color: red;"/>
                            </p:column>


                        </p:dataTable>
                    </p:panel>
                </p:panel>        
            </h:form>
        </h:panelGroup>
    </ui:define>

</ui:composition>
